It's 2020, there's no need to be restrained with registering atoms.
"WM_PROTOCOLS",
"WM_TAKE_FOCUS",
"WM_WINDOW_ROLE",
+ "WM_STATE",
"_NET_ACTIVE_WINDOW",
"_NET_CURRENT_DESKTOP",
"_NET_FRAME_EXTENTS",
"_NET_VIRTUAL_ROOTS",
"GDK_SELECTION",
"_NET_WM_STATE_FOCUSED",
- "GDK_VISUALS"
+ "GDK_VISUALS",
+ "XdndAware",
+ "XdndProxy",
+ "XdndActionAsk",
+ "XdndActionCopy",
+ "XdndActionLink",
+ "XdndActionList",
+ "XdndActionMove",
+ "XdndActionPrivate",
+ "XdndDrop",
+ "XdndEnter",
+ "XdndFinished",
+ "XdndLeave",
+ "XdndPosition",
+ "XdndSelection",
+ "XdndStatus",
+ "XdndTypeList"
};
static char *gdk_sm_client_id;
gulong user_time;
/* Sets of atoms for DND */
- guint base_dnd_atoms_precached : 1;
- guint xdnd_atoms_precached : 1;
- guint motif_atoms_precached : 1;
guint use_sync : 1;
guint have_shapes : 1;
return retval ? (proxy ? proxy : win) : None;
}
-/* Target side */
-
-static void
-base_precache_atoms (GdkDisplay *display)
-{
- GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
-
- if (!display_x11->base_dnd_atoms_precached)
- {
- static const char *const precache_atoms[] = {
- "WM_STATE",
- "XdndAware",
- "XdndProxy"
- };
-
- _gdk_x11_precache_atoms (display,
- precache_atoms, G_N_ELEMENTS (precache_atoms));
-
- display_x11->base_dnd_atoms_precached = TRUE;
- }
-}
-
-static void
-xdnd_precache_atoms (GdkDisplay *display)
-{
- GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
-
- if (!display_x11->xdnd_atoms_precached)
- {
- static const gchar *const precache_atoms[] = {
- "XdndActionAsk",
- "XdndActionCopy",
- "XdndActionLink",
- "XdndActionList",
- "XdndActionMove",
- "XdndActionPrivate",
- "XdndDrop",
- "XdndEnter",
- "XdndFinished",
- "XdndLeave",
- "XdndPosition",
- "XdndSelection",
- "XdndStatus",
- "XdndTypeList"
- };
-
- _gdk_x11_precache_atoms (display,
- precache_atoms, G_N_ELEMENTS (precache_atoms));
-
- display_x11->xdnd_atoms_precached = TRUE;
- }
-}
-
/* Source side */
static void
GdkSurface *surface;
Window retval;
- base_precache_atoms (display);
-
/* Check for a local drag */
surface = gdk_x11_surface_lookup_for_display (display, xid);
if (surface)
{
*protocol = GDK_DRAG_PROTO_XDND;
*version = 5;
- xdnd_precache_atoms (display);
GDK_DISPLAY_NOTE (display, DND, g_message ("Entering local Xdnd window %#x\n", (guint) xid));
return xid;
}
else if ((retval = xdnd_check_dest (display, xid, version)))
{
*protocol = GDK_DRAG_PROTO_XDND;
- xdnd_precache_atoms (display);
GDK_DISPLAY_NOTE (display, DND, g_message ("Entering Xdnd window %#x\n", (guint) xid));
return retval;
}
g_return_if_fail (surface != NULL);
- base_precache_atoms (display);
-
if (g_object_get_data (G_OBJECT (surface), "gdk-dnd-registered") != NULL)
return;
else
return FALSE;
}
-static void
-xdnd_precache_atoms (GdkDisplay *display)
-{
- GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
-
- if (!display_x11->xdnd_atoms_precached)
- {
- static const gchar *const precache_atoms[] = {
- "XdndActionAsk",
- "XdndActionCopy",
- "XdndActionLink",
- "XdndActionList",
- "XdndActionMove",
- "XdndActionPrivate",
- "XdndDrop",
- "XdndEnter",
- "XdndFinished",
- "XdndLeave",
- "XdndPosition",
- "XdndSelection",
- "XdndStatus",
- "XdndTypeList"
- };
-
- _gdk_x11_precache_atoms (display,
- precache_atoms, G_N_ELEMENTS (precache_atoms));
-
- display_x11->xdnd_atoms_precached = TRUE;
- }
-}
-
static gboolean
xdnd_enter_filter (GdkSurface *surface,
const XEvent *xevent)
display = gdk_surface_get_display (surface);
display_x11 = GDK_X11_DISPLAY (display);
- xdnd_precache_atoms (display);
-
GDK_DISPLAY_NOTE (display, DND,
g_message ("XdndEnter: source_window: %#lx, version: %#x",
source_window, version));
g_message ("XdndLeave: source_window: %#lx",
source_window));
- xdnd_precache_atoms (display);
-
if ((display_x11->current_drop != NULL) &&
(GDK_X11_DROP (display_x11->current_drop)->source_window == source_window))
{
g_message ("XdndPosition: source_window: %#lx position: (%d, %d) time: %d action: %ld",
source_window, x_root, y_root, time, action));
- xdnd_precache_atoms (display);
-
drop = display_x11->current_drop;
drop_x11 = GDK_X11_DROP (drop);
g_message ("XdndDrop: source_window: %#lx time: %d",
source_window, time));
- xdnd_precache_atoms (display);
-
drop = display_x11->current_drop;
drop_x11 = GDK_X11_DROP (drop);